const router = require("koa-router")();
const main = require("../../models");
const { ObjectId } = require("mongodb");

router.get("/doDelete", async ctx => {
    var { _id, title } = ctx.query;
    var table = await main("top250");
    /**删除数据库中对应字段 */
    await table.deleteOne({ _id: ObjectId(_id) })
    await ctx.redirect("/home")
})

module.exports = router;